{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 一、对chipotle.csv文件的销售数据进行分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "####  1、把chipotle.csv文件内容读取到一个名为chipo的数据框中，并显示该文件的前10行记录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>quantity</th>\n",
       "      <th>item_name</th>\n",
       "      <th>choice_description</th>\n",
       "      <th>item_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "      <td>NaN</td>\n",
       "      <td>$2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Izze</td>\n",
       "      <td>[Clementine]</td>\n",
       "      <td>$3.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Nantucket Nectar</td>\n",
       "      <td>[Apple]</td>\n",
       "      <td>$3.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
       "      <td>NaN</td>\n",
       "      <td>$2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n",
       "      <td>$16.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>[Fresh Tomato Salsa (Mild), [Rice, Cheese, Sou...</td>\n",
       "      <td>$10.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>Side of Chips</td>\n",
       "      <td>NaN</td>\n",
       "      <td>$1.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>Steak Burrito</td>\n",
       "      <td>[Tomatillo Red Chili Salsa, [Fajita Vegetables...</td>\n",
       "      <td>$11.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>Steak Soft Tacos</td>\n",
       "      <td>[Tomatillo Green Chili Salsa, [Pinto Beans, Ch...</td>\n",
       "      <td>$9.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>Steak Burrito</td>\n",
       "      <td>[Fresh Tomato Salsa, [Rice, Black Beans, Pinto...</td>\n",
       "      <td>$9.25</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   order_id  quantity                              item_name  \\\n",
       "0         1         1           Chips and Fresh Tomato Salsa   \n",
       "1         1         1                                   Izze   \n",
       "2         1         1                       Nantucket Nectar   \n",
       "3         1         1  Chips and Tomatillo-Green Chili Salsa   \n",
       "4         2         2                           Chicken Bowl   \n",
       "5         3         1                           Chicken Bowl   \n",
       "6         3         1                          Side of Chips   \n",
       "7         4         1                          Steak Burrito   \n",
       "8         4         1                       Steak Soft Tacos   \n",
       "9         5         1                          Steak Burrito   \n",
       "\n",
       "                                  choice_description item_price  \n",
       "0                                                NaN     $2.39   \n",
       "1                                       [Clementine]     $3.39   \n",
       "2                                            [Apple]     $3.39   \n",
       "3                                                NaN     $2.39   \n",
       "4  [Tomatillo-Red Chili Salsa (Hot), [Black Beans...    $16.98   \n",
       "5  [Fresh Tomato Salsa (Mild), [Rice, Cheese, Sou...    $10.98   \n",
       "6                                                NaN     $1.69   \n",
       "7  [Tomatillo Red Chili Salsa, [Fajita Vegetables...    $11.75   \n",
       "8  [Tomatillo Green Chili Salsa, [Pinto Beans, Ch...     $9.25   \n",
       "9  [Fresh Tomato Salsa, [Rice, Black Beans, Pinto...     $9.25   "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo=pd.read_csv(\"chipotle.csv\")\n",
    "chipo.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 2、获取chipo数据框中每列的数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "order_id               int64\n",
       "quantity               int64\n",
       "item_name             object\n",
       "choice_description    object\n",
       "item_price            object\n",
       "dtype: object"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 3、获取数据框chipo中所有订单购买商品的总数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4972"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo['quantity'].sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 4、给出数据框chipo中包含的订单数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1834"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo['order_id'].unique().size"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 5、查询出购买同一种商品数量超过3个的所有订单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>quantity</th>\n",
       "      <th>item_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1254</th>\n",
       "      <td>511</td>\n",
       "      <td>4</td>\n",
       "      <td>Chicken Burrito</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1257</th>\n",
       "      <td>511</td>\n",
       "      <td>4</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1425</th>\n",
       "      <td>577</td>\n",
       "      <td>4</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1880</th>\n",
       "      <td>759</td>\n",
       "      <td>4</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2235</th>\n",
       "      <td>901</td>\n",
       "      <td>4</td>\n",
       "      <td>Canned Soda</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2441</th>\n",
       "      <td>970</td>\n",
       "      <td>5</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3598</th>\n",
       "      <td>1443</td>\n",
       "      <td>15</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3599</th>\n",
       "      <td>1443</td>\n",
       "      <td>7</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3602</th>\n",
       "      <td>1443</td>\n",
       "      <td>4</td>\n",
       "      <td>Chicken Burrito</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3887</th>\n",
       "      <td>1559</td>\n",
       "      <td>8</td>\n",
       "      <td>Side of Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3973</th>\n",
       "      <td>1592</td>\n",
       "      <td>4</td>\n",
       "      <td>Canned Soft Drink</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4152</th>\n",
       "      <td>1660</td>\n",
       "      <td>10</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4489</th>\n",
       "      <td>1786</td>\n",
       "      <td>4</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4490</th>\n",
       "      <td>1786</td>\n",
       "      <td>4</td>\n",
       "      <td>Canned Soft Drink</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4491</th>\n",
       "      <td>1786</td>\n",
       "      <td>4</td>\n",
       "      <td>Canned Soft Drink</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      order_id  quantity                     item_name\n",
       "1254       511         4               Chicken Burrito\n",
       "1257       511         4  Chips and Fresh Tomato Salsa\n",
       "1425       577         4                 Bottled Water\n",
       "1880       759         4                 Bottled Water\n",
       "2235       901         4                   Canned Soda\n",
       "2441       970         5                 Bottled Water\n",
       "3598      1443        15  Chips and Fresh Tomato Salsa\n",
       "3599      1443         7                 Bottled Water\n",
       "3602      1443         4               Chicken Burrito\n",
       "3887      1559         8                 Side of Chips\n",
       "3973      1592         4             Canned Soft Drink\n",
       "4152      1660        10                 Bottled Water\n",
       "4489      1786         4           Chips and Guacamole\n",
       "4490      1786         4             Canned Soft Drink\n",
       "4491      1786         4             Canned Soft Drink"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.loc[chipo['quantity']>3,'order_id':'item_name']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 6、查询出同时购买‘Chicken Bowl’和'Steak Bowl'商品的所有订单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>item_name_x</th>\n",
       "      <th>item_name_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>360</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>362</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>561</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>577</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>720</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>759</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>916</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1006</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1057</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>1166</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1223</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>1449</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1768</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>Chicken Soft Tacos</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    order_id   item_name_x         item_name_y\n",
       "0         34  Chicken Bowl  Chicken Soft Tacos\n",
       "2        360  Chicken Bowl  Chicken Soft Tacos\n",
       "3        362  Chicken Bowl  Chicken Soft Tacos\n",
       "4        561  Chicken Bowl  Chicken Soft Tacos\n",
       "5        577  Chicken Bowl  Chicken Soft Tacos\n",
       "6        720  Chicken Bowl  Chicken Soft Tacos\n",
       "7        759  Chicken Bowl  Chicken Soft Tacos\n",
       "10       916  Chicken Bowl  Chicken Soft Tacos\n",
       "12      1006  Chicken Bowl  Chicken Soft Tacos\n",
       "13      1057  Chicken Bowl  Chicken Soft Tacos\n",
       "15      1166  Chicken Bowl  Chicken Soft Tacos\n",
       "16      1223  Chicken Bowl  Chicken Soft Tacos\n",
       "17      1449  Chicken Bowl  Chicken Soft Tacos\n",
       "18      1768  Chicken Bowl  Chicken Soft Tacos"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1=chipo.loc[chipo['item_name']==\"Chicken Bowl\",[\"order_id\",'item_name']]\n",
    "df2=chipo.loc[chipo['item_name']==\"Chicken Soft Tacos\",[\"order_id\",'item_name']]\n",
    "df3=df1.merge(df2,on='order_id').drop_duplicates()\n",
    "df3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 7、找出购买商品数量最多的5个订单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>quantity</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>order_id</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1443</th>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>926</th>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1786</th>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1660</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>759</th>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          quantity\n",
       "order_id          \n",
       "1443            35\n",
       "926             23\n",
       "1786            20\n",
       "1660            19\n",
       "759             18"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.groupby(\"order_id\").sum().sort_values(\"quantity\",ascending=False).head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 8、找出choice_description字段缺失的商品名称及其订单编号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>item_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3</td>\n",
       "      <td>Side of Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>5</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>7</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>8</td>\n",
       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>10</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>13</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>15</td>\n",
       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>16</td>\n",
       "      <td>Side of Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>17</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>18</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>18</td>\n",
       "      <td>Chips and Tomatillo Green Chili Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>19</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>20</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>22</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>25</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>27</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>28</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>31</td>\n",
       "      <td>Side of Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>32</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>33</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>34</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>35</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>38</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>39</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>41</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>42</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>44</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>45</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4507</th>\n",
       "      <td>1792</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4509</th>\n",
       "      <td>1793</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4512</th>\n",
       "      <td>1794</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4515</th>\n",
       "      <td>1795</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4517</th>\n",
       "      <td>1796</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4525</th>\n",
       "      <td>1799</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4529</th>\n",
       "      <td>1800</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4531</th>\n",
       "      <td>1801</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4534</th>\n",
       "      <td>1803</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4539</th>\n",
       "      <td>1804</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4542</th>\n",
       "      <td>1806</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4544</th>\n",
       "      <td>1806</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4548</th>\n",
       "      <td>1808</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4551</th>\n",
       "      <td>1809</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4563</th>\n",
       "      <td>1814</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4567</th>\n",
       "      <td>1816</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4568</th>\n",
       "      <td>1817</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4570</th>\n",
       "      <td>1817</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4575</th>\n",
       "      <td>1819</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4579</th>\n",
       "      <td>1821</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4582</th>\n",
       "      <td>1822</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4584</th>\n",
       "      <td>1823</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4588</th>\n",
       "      <td>1824</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4596</th>\n",
       "      <td>1826</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4598</th>\n",
       "      <td>1826</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4600</th>\n",
       "      <td>1827</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4605</th>\n",
       "      <td>1828</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4613</th>\n",
       "      <td>1831</td>\n",
       "      <td>Chips</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4614</th>\n",
       "      <td>1831</td>\n",
       "      <td>Bottled Water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4616</th>\n",
       "      <td>1832</td>\n",
       "      <td>Chips and Guacamole</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1246 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      order_id                              item_name\n",
       "0            1           Chips and Fresh Tomato Salsa\n",
       "3            1  Chips and Tomatillo-Green Chili Salsa\n",
       "6            3                          Side of Chips\n",
       "10           5                    Chips and Guacamole\n",
       "14           7                    Chips and Guacamole\n",
       "15           8  Chips and Tomatillo-Green Chili Salsa\n",
       "20          10                    Chips and Guacamole\n",
       "25          13           Chips and Fresh Tomato Salsa\n",
       "30          15  Chips and Tomatillo-Green Chili Salsa\n",
       "32          16                          Side of Chips\n",
       "34          17                          Bottled Water\n",
       "37          18                    Chips and Guacamole\n",
       "38          18  Chips and Tomatillo Green Chili Salsa\n",
       "40          19                                  Chips\n",
       "41          20                    Chips and Guacamole\n",
       "49          22                    Chips and Guacamole\n",
       "55          25           Chips and Fresh Tomato Salsa\n",
       "59          27                                  Chips\n",
       "60          28                    Chips and Guacamole\n",
       "70          31                          Side of Chips\n",
       "72          32                    Chips and Guacamole\n",
       "74          33                    Chips and Guacamole\n",
       "77          34                                  Chips\n",
       "80          35                                  Chips\n",
       "87          38                          Bottled Water\n",
       "89          39           Chips and Fresh Tomato Salsa\n",
       "94          41                    Chips and Guacamole\n",
       "96          42                    Chips and Guacamole\n",
       "100         44                    Chips and Guacamole\n",
       "103         45                    Chips and Guacamole\n",
       "...        ...                                    ...\n",
       "4507      1792                          Bottled Water\n",
       "4509      1793                                  Chips\n",
       "4512      1794                    Chips and Guacamole\n",
       "4515      1795                    Chips and Guacamole\n",
       "4517      1796                          Bottled Water\n",
       "4525      1799                                  Chips\n",
       "4529      1800                    Chips and Guacamole\n",
       "4531      1801                    Chips and Guacamole\n",
       "4534      1803                    Chips and Guacamole\n",
       "4539      1804                    Chips and Guacamole\n",
       "4542      1806                          Bottled Water\n",
       "4544      1806                          Bottled Water\n",
       "4548      1808                    Chips and Guacamole\n",
       "4551      1809                    Chips and Guacamole\n",
       "4563      1814                    Chips and Guacamole\n",
       "4567      1816                    Chips and Guacamole\n",
       "4568      1817                          Bottled Water\n",
       "4570      1817                          Bottled Water\n",
       "4575      1819                    Chips and Guacamole\n",
       "4579      1821                    Chips and Guacamole\n",
       "4582      1822                          Bottled Water\n",
       "4584      1823                                  Chips\n",
       "4588      1824                    Chips and Guacamole\n",
       "4596      1826                    Chips and Guacamole\n",
       "4598      1826                          Bottled Water\n",
       "4600      1827                    Chips and Guacamole\n",
       "4605      1828                    Chips and Guacamole\n",
       "4613      1831                                  Chips\n",
       "4614      1831                          Bottled Water\n",
       "4616      1832                    Chips and Guacamole\n",
       "\n",
       "[1246 rows x 2 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.loc[chipo['choice_description'].isnull(),[\"order_id\",'item_name']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 9、将item_price列的数据转换为浮点数类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>quantity</th>\n",
       "      <th>item_name</th>\n",
       "      <th>choice_description</th>\n",
       "      <th>item_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Fresh Tomato Salsa</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Izze</td>\n",
       "      <td>[Clementine]</td>\n",
       "      <td>3.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Nantucket Nectar</td>\n",
       "      <td>[Apple]</td>\n",
       "      <td>3.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>Chicken Bowl</td>\n",
       "      <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n",
       "      <td>16.98</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   order_id  quantity                              item_name  \\\n",
       "0         1         1           Chips and Fresh Tomato Salsa   \n",
       "1         1         1                                   Izze   \n",
       "2         1         1                       Nantucket Nectar   \n",
       "3         1         1  Chips and Tomatillo-Green Chili Salsa   \n",
       "4         2         2                           Chicken Bowl   \n",
       "\n",
       "                                  choice_description  item_price  \n",
       "0                                                NaN        2.39  \n",
       "1                                       [Clementine]        3.39  \n",
       "2                                            [Apple]        3.39  \n",
       "3                                                NaN        2.39  \n",
       "4  [Tomatillo-Red Chili Salsa (Hot), [Black Beans...       16.98  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#dollarizer = lambda x: float(x[1:])\n",
    "#chipo['item_price'] = chipo['item_price'].apply(dollarizer)\n",
    "chipo['item_price'] = chipo['item_price'].str[1:]\n",
    "chipo['item_price']=chipo['item_price'].astype(float)\n",
    "chipo.dtypes\n",
    "chipo.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 10、找出销售额最多的前5个订单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>item_price</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>order_id</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>926</th>\n",
       "      <td>205.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443</th>\n",
       "      <td>160.74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1483</th>\n",
       "      <td>139.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>691</th>\n",
       "      <td>118.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1786</th>\n",
       "      <td>114.30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          item_price\n",
       "order_id            \n",
       "926           205.25\n",
       "1443          160.74\n",
       "1483          139.00\n",
       "691           118.25\n",
       "1786          114.30"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.groupby(\"order_id\").agg({\"item_price\":\"sum\"}).sort_values(\"item_price\",ascending=False).head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 11、找出单价最高的商品"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "order_id                                      1443\n",
       "quantity                                        15\n",
       "item_name             Chips and Fresh Tomato Salsa\n",
       "choice_description                             NaN\n",
       "item_price                                   44.25\n",
       "Name: 3598, dtype: object"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.loc[chipo['item_price'].argmax(),:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 12、找出平均单价最高的商品"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "item_name\n",
       "Bowl    14.8\n",
       "Name: item_price, dtype: float64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chipo.groupby(\"item_name\")[\"item_price\"].mean().sort_values(ascending=False).head(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二、对描述泰坦尼克号成员的信息进行可视化和相关分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 13、打开train.csv文件，把其内容读入到一个名为titanic的数据框中，并绘制一个展示幸存者(Survived字段值为1)中男女乘客比例的扇形图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XecXGXd/vHPlU2BAAFC6II0+YHSm4BSoigYRGnSlBYU\n8AERBBX00XUsj0ivj9KbAkpHEEFApCkQiiACIigdHkpAWkj7/v64z5LJZpNssjtz37NzvV+vebEz\nO3POtbthrrnPuc85igjMzMxKMyh3ADMzs564oMzMrEguKDMzK5ILyszMiuSCMjOzIrmgrEeShuXO\n0E4kLSJpcO4cZiVxQdnMnCVpl56+IWkZSU83K4ik/ST9pIHLP0jS//byucMlHS1poTlY/j8krTyb\np90ArNjtdd+TdHhv11P3upUl3TWb50yUNM8svr+dpK/O4vvflbR43f2PS5qv7v4wSWdJGtLDazeV\n9LUeHv+NpE/PKre1FxeUASBpL0l/kXSLpFuAMcChXfer7+1VPf09YGLdaydKGld3e1LSud2Wf6Gk\nFyQ92sPtDUlfrnvuMEn1/zYnAm/XfX+QpKHdlr+dpJe75Rgn6VlJh3Z77sqSHul6DnAIsEPdax6R\n9MW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VyQVlZmZFckGZmVmRXFBmZlYkF5SZ\nmRXJBWVmZkVyQZmZWZFcUGZmViQXlJmZFckFZWZmRXJBmZlZkVxQZmZWJBeUmZkVyQVlZmZF+v/C\nnTLECLXS5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9fcb9b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "titanic = pd.read_csv(\"train.csv\")\n",
    "plt.rcParams['font.sans-serif']=['SimHei']\n",
    "# sum the instances of males and females\n",
    "males = ((titanic['Survived'] == 1)&(titanic['Sex'] == 'male')).sum()\n",
    "females = ((titanic['Survived'] == 1)&(titanic['Sex'] == 'female')).sum()\n",
    "\n",
    "# put them into a list called proportions\n",
    "proportions = [males, females]\n",
    "\n",
    "# Create a pie chart\n",
    "plt.pie(\n",
    "    # using proportions\n",
    "    proportions,\n",
    "    \n",
    "    # with the labels being officer names\n",
    "    labels = ['男性', '女性'],\n",
    "    \n",
    "    # with no shadows\n",
    "    shadow = False,\n",
    "    \n",
    "    # with colors\n",
    "    colors = ['green','red'],\n",
    "    \n",
    "    # with one slide exploded out\n",
    "    explode = (0.15 , 0),\n",
    "    \n",
    "    # with the start angle at 90%\n",
    "    startangle = 90,\n",
    "    \n",
    "    # with the percent listed as a fraction\n",
    "    autopct = '%1.1f%%'\n",
    "    )\n",
    "\n",
    "# View the plot drop above\n",
    "plt.axis('equal')\n",
    "\n",
    "# Set labels\n",
    "plt.title(\"泰坦尼克号幸存者性别比例统计\")\n",
    "\n",
    "# View the plot\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 14、通过直方图统计幸存者中各年龄段中的人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 38.  41.  77.  73.  34.  20.   6.   0.   1.]\n",
      "[  0.  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ay/\nnEgaCdwCXEh5t8uVwK0RsTF9Xs5tATAGmBMR64G7gSWUb3t8BfhsRHwN+BVwLmXUFv31zfmyfnb1\nPu8HvhQRr1De7XIicJmkRuCDwGmUb1sA/AY4NJ2uBWoo3/aoAj4gqQIYC8yijNqiX17sI2k4sBT4\nCell/UW+KrRfkjQNuBZ4Pp11JzADt0sj8DHK+G9E0jDgDpKhgoEkB70fpgzbQ9JxJP9vHAIsB86k\njP42+mWIQ3LaEHASsCT9ymi4XXK5Ldpze+xWTm3Rb0PczMzy669j4mZmVgCHuJlZhjnEzcwyzCFu\nZpZhDnEzswz7byQ9DcdKmq6dAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9e2fac8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "svd_age=titanic.loc[(titanic['Survived'] == 1)&(titanic['Age']),'Age']\n",
    "svd_age_lst=list(svd_age.data)\n",
    "svd_age_min=int(min(svd_age_lst))//10\n",
    "svd_age_max=int(max(svd_age_lst))//10\n",
    "#age_nums=[]\n",
    "#for age in range(svd_age_min*10,(svd_age_max+1)*10,10):\n",
    "#    nums=((titanic['Survived'] == 1)&(titanic['Age']>=age)&(titanic['Age']<(age+10))).sum()\n",
    "#    age_nums.append(nums)\n",
    "#age_1=((titanic['Survived'] == 1)&(titanic['Age'].between(0,10))).sum()\n",
    "#print(age_nums)\n",
    "#n,bins,patches=plt.hist(svd_age_lst, bins = range(svd_age_min*10,(svd_age_max+2)*10,10))\n",
    "n,bins,_=plt.hist(svd_age_lst,bins=9,range=(0,90))\n",
    "print(n)\n",
    "print(bins)\n",
    "#print(patches)\n",
    "for i in range(len(n)):\n",
    "    plt.text(bins[i]+(bins[1]-bins[0])/2,n[i]*1.01,'{}'.format(int(n[i])), ha='center', va='bottom')\n",
    "plt.title(\"幸存者年龄段人数统计\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 15、统计不同等级舱位(通过Pclass字段值表示舱位等级)的存活率并通过柱形图加以展示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEICAYAAABLdt/UAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHg5JREFUeJzt3XucVXW9//HXW27ZYKIJTkZBKqakgjQo/kIbS0gkLVHE\njqk9FPEh6snMUo9kXjA4pp5KvESgmaFHitIjPoTJI5PYDy+D4vFyVIzwVtD0m+EikTPB5/fHWsB2\ns4dZM84FFu/n48HDtdf+fNf+rr3G9/ru71p7RhGBmZnlxy6d3QEzM2tbDnYzs5xxsJuZ5YyD3cws\nZxzsZmY542C3nYIklVjXtTP6YtbeHOyWiaQPlQrHopquklr8MyVpV0lPS+pftH6mpKOaaHOspE+0\n4GWGSfpd0brfSxrSxPYPktSnaF1vSYObqD9b0u0Fj/9V0nVZOpbW3pax9sOSfiipV5b6tM33JX09\na73t+DxisaxeBd6TtDF93AXYD3itoKY7cLKk+4GPAP9sYltdgHURsX96srgZ+DgwT9LfgfeAh4BT\ngQMl7QmsBv4zIn6UnjxuBL4mqRL4Ufp6fwa6AbtExNCi1zwE+MOmB2kw7gU810QfrwXmAncXrPsG\nMFHSvrH1F0DGAI8UPH4ImC/pBxGxvrBQ0gHAg8C6dNVHgQ9LOjx9XAZMjohZaX13YENEbABGA0Mi\nYlXB9nYBukXEe+njmcAAYNOx+kS6/fHp4y7A3yLipCb23XZw8heUrDUkXQhURMQ3Sjz3EnAy8MeI\naCx6rivQF3gwIgZJGghcA4wH/g9JCP0TqCAJ15XAw8CVEfFcuo1zgP7Az4CvALOBmRHxZUnHA6dE\nxNkFr/kQMBRYT3KCmExyIpgCrE3LyiOiZ1r/OrApOD8NHAz8BagBXgQej4g7CrbfH/gj8DHgp0A/\nklAVsOl/sF2BoRHx9xLv1zeAwRFxcfFz6fMz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eCddrgP2LlFzJvAycANwuKSLigsiYnpEVERERe/ezf4t\nVjMza6Uswf4usGu63LOJNocB0yNiBfBL4Ji26Z6ZmbVUlmBfzJbpl0HA8hI1rwP7pssVQKa/pG1m\nZm0vyy8BewBYKGkfYBRwmqTJEVF4h8xM4E5JpwHdgFPavqtmZpZFs8EeEWskVQIjgBvS6Zbni2rW\nAmPbpYdmZtYimX5tb0TUs+XOGDMz2475m6dmZjnjYDczyxkHu5lZzjjYzcxyxsFuZpYzDnYzs5xx\nsJuZ5YyD3cwsZxzsZmY542A3M8sZB7uZWc442M3McsbBbmaWMw52M7OccbCbmeWMg93MLGcc7GZm\nOeNgNzPLGQe7mVnOONjNzHLGwW5mljMOdjOznHGwm5nljIPdzCxnMgW7pJmSFkma1MTzXSW9Kak6\n/XdI23bTzMyyajbYJY0BukTEkcC+kgaUKDsUuC8iKtN/L7R1R822VytXrqSxsbGzu2G2WZYReyUw\nO12uAoaXqBkGfFnS0+novmtxgaQJkmok1dTW1ra6w2YtsXLlSg477DBuv/12KisrqaysZPDgwZx3\n3nkl61evXs2oUaMYOXIkJ510Eg0NDdTX13P88cdTUVGxud20adMYOnQo69atY/78+XTr1q0jd8ts\nm7IEexnwTrpcB+xdouYZ4NiIOBzoBhxfXBAR0yOiIiIqevfu3dr+mrXIpZdeyvr16zn//POprq6m\nurqao446inPPPbdk/axZs7jkkkuoqqqivLycefPmcc8993D66adTU1PD2rVrqampYcmSJYwfP55n\nnnmGsrKyDt4rs23bamRdwrvArulyT0qfDP4nIt5Ll2uAUtM1Zh3qscceo6ysjPLy8s3r3nnnHVau\nXElFRUXJNhMnTty8XFtbS58+fVi7di0vvvgiq1at4q233uITn/gEEUFjYyNVVVVMmlTy0pNZp8ky\nYl/MlumXQcDyEjX3SBokqQvwVeD5tumeWes0NDRw3XXXMXXq1Petv/XWWzn//PObbb9o0SLq6+sZ\nNmwYw4cP54033uAnP/kJBx10EHvuuScjR45k7ty59O3blxNPPJEFCxa0166YtViWYH8AOE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OB5BNVV5JjWWg1cABwFtAjXfciMELShRExrd06\nvxOKiN8DpJ+sDgeuJfl/xscrIwd7C6W3dpJM5YGknwL9gU0ffT4OfIZkFN6QlOge4HPASKAvyej+\nOJIR+8Ek8/P3ONTbl6QjgT1IvmtxLcmJGJKw3wh8ieQ4bpD030B3kk9gHwI+CVxMMgL8LNCL5JNZ\n4UnD2kg6Vz6O5JPVlSSfin28MnKwf0ARcZ6kHhHxXuF6ST8i+eLWHyKiUdLvSH4IHyQJ9XXAPyLi\nDklfIfnBs3aSTpndApwcEW9I6gE0RMFcpKSLSa6TzIqIxnTdUOBnwADg72npTGA/4KsRsRFrc+lx\nuUDSdSSj7avw8crMwd42Hk6DYl3BugNJRunLSEYee5CMPv4VeH1TkaQvAd8mGeFbO5DUHfgVcEVE\nvJGungnsIymAxnRdP5KP+mdKGgF8mCQcTqfgmJF8yvoP4Lsd0P2djqTLgL9ExC9IBjyr8PFqkZ3m\nKnF7iohjgYdILpQeFxHHkYzMvxMR49Kyg4FXST4aimT03i0i5kfE0cAJkvzrjtvHOSS/cfRKSdWS\nxkXE14E7gFcLjtl04MaI+EJEbGDLMZtAMm8b6b/X0r898PH0rihrW9OBMyQ9TnL7cJWPV8t4xN5K\nEVFZtOpmYARA+lekjgN+XPD8KOB6YF/gZOA7wKuSakh+O+ZHgRnt2+udU0TcDtxeYv1sSesBJJ0H\njAfOKygZRXJHRjfgCpJb7hYD1ZLqSOZ6x7Rv73c+EVFP+v9S0Xofr4x8u2M7kNQbWB0RDQXr+kbE\n2+lFoW6Fz1nnS+fg10fE+oJ1HwP+GhEbSl1Hsc7j47VtDnYzs5zxHLuZWc442M3McsbBbmaWMw52\nM7OccbCbmeWMg93MLGf+P4l7HJtjafOsAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xb641320>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.rcParams['font.sans-serif']=['SimHei']\n",
    "pclass_total=titanic.groupby('Pclass')[\"PassengerId\"].count()\n",
    "#print(pclass_total)\n",
    "pclass_svd=titanic.loc[titanic['Survived'] == 1,:].groupby('Pclass')[\"PassengerId\"].count()\n",
    "svd_rto=pclass_svd/pclass_total\n",
    "#print(pclass_svd)\n",
    "#print(pclass_svd/pclass_total)\n",
    "plt.bar(pclass_total.index,pclass_svd/pclass_total)\n",
    "#plt.yticks(range(0,0.9,0.1))\n",
    "plt.xticks(pclass_total.index,[str(i)+\"等舱\" for i in pclass_total.index])\n",
    "plt.title(\"不同等级的舱位幸存率\")\n",
    "for i in pclass_total.index:\n",
    "    plt.text(i,svd_rto[i]*1.01,f\"{svd_rto[i]:.2%}\", ha='center', va='bottom')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#### 16、以数据透视表形式展示不同等级舱位、不同性别的遇难者/幸存者人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th>Pclass</th>\n",
       "      <th colspan=\"2\" halign=\"left\">1</th>\n",
       "      <th colspan=\"2\" halign=\"left\">2</th>\n",
       "      <th colspan=\"2\" halign=\"left\">3</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sex</th>\n",
       "      <th>female</th>\n",
       "      <th>male</th>\n",
       "      <th>female</th>\n",
       "      <th>male</th>\n",
       "      <th>female</th>\n",
       "      <th>male</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Survived</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>77</td>\n",
       "      <td>6</td>\n",
       "      <td>91</td>\n",
       "      <td>72</td>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>91</td>\n",
       "      <td>45</td>\n",
       "      <td>70</td>\n",
       "      <td>17</td>\n",
       "      <td>72</td>\n",
       "      <td>47</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Pclass        1           2           3     \n",
       "Sex      female male female male female male\n",
       "Survived                                    \n",
       "0             3   77      6   91     72  300\n",
       "1            91   45     70   17     72   47"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "titanic.pivot_table(index='Survived',columns=['Pclass','Sex'],values='PassengerId',aggfunc='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
